package com.tcs.test.spring.condition.config;

import com.tcs.test.spring.condition.LinuxCondition;
import com.tcs.test.spring.condition.WindowsCondition;
import com.tcs.test.spring.condition.show.IShow;
import com.tcs.test.spring.condition.show.LinuxShow;
import com.tcs.test.spring.condition.show.WindowsShow;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ConditionConfig {

    @Bean
    @Conditional(LinuxCondition.class)
    public IShow linuxShow() {
        return new LinuxShow();
    }

    @Bean
    @Conditional(WindowsCondition.class)
    public IShow windowsShow() {
        return new WindowsShow();
    }

}
